<template>
  <div>
    <!-- 搜索栏区域 -->
    <el-card class="SearchCard" body-style="padding:0px">
      <el-row>
        <el-col :span="2">
          <div class="SearchTitle">条件搜索栏</div>
        </el-col>
        <el-col :span="4">
          <el-row>
            <el-col :span="10">
              <div class="SearchLable">搜索关键字</div>
            </el-col>
            <el-col :span="14">
              <div class="SearchLable">
                <el-input placeholder="请输入内容" v-model="queryInfo.srm" clearable @clear="clearEvent"></el-input>
              </div>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="2">
          <div class="SearchLable">
            <el-button size="medium" type="primary" @click="getSearchList()">搜索</el-button>
          </div>
        </el-col>
      </el-row>
    </el-card>
    <el-card class="TableCard" :body-style="{ padding: '0px' }">
      <div>
        <el-table
          :data="tableData"
          border
          height="550"
          :header-cell-style="{ 'text-align':'center',background: '#3F9DFD', color: '#FFF' }"
          :cell-style="{'text-align':'center'}"
          size="medium"
          stripe
          style="width: 100%;font-size:12px"
        >
          <el-table-column prop="drugCode" label="药品编码" width="100"></el-table-column>
          <el-table-column prop="name" label="操作" width="130">
            <template slot-scope="scope">
              <el-button
                type="text"
                size="mini"
                v-if="scope.row.contrScrDrugId>0"
                @click="showRuleAll(scope.row.drugCode,scope.row.contrScrDrugId)"
              >查看</el-button>
              <el-button
                type="text"
                style="margin-left:12px"
                size="mini"
                @click="showAddRule(scope.row.drugCode)"
              >新增</el-button>
            </template>
          </el-table-column>
          <el-table-column prop="drugName" label="药品名称"></el-table-column>

          <!-- <el-table-column prop="cbrand" label="商品名"></el-table-column> -->
          <el-table-column label="药品类型">
            <template slot-scope="scope">
              <div v-if="scope.row.nameType==8">西药</div>
              <div v-else-if="scope.row.nameType==2">草药</div>
              <div v-else-if="scope.row.nameType==6">中成药</div>
            </template>
          </el-table-column>
          <el-table-column prop="drugSpec" label="药品规格"></el-table-column>
          <el-table-column prop="compName" label="药品生产厂家" width="220"></el-table-column>
          <!-- <el-table-column prop="approvalCode" label="批准文号"></el-table-column> -->
          <!-- <el-table-column prop="doseUnit" label="批准文号"></el-table-column> -->
        </el-table>
      </div>
      <div class="block">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="queryInfo.pagenum"
          :page-sizes="[20, 50, 100]"
          :page-size="queryInfo.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="this.total"
          background
        ></el-pagination>
      </div>
    </el-card>

    <!-- 新增规则 -->
    <el-dialog title="新增规则" :visible.sync="dialogVisible" width="35%" :before-close="handleClose">
      <div class="addRuleAdverse">
        <el-form
          :inline="true"
          :model="addRuleData"
          class="demo-form-inline addForm"
          label-width="150px"
        >
          <el-form-item label="疾病ID">
            <el-input v-model="addRuleData.diseaseName" size="medium">
              <el-button slot="append" @click="showDisease(1)">选择</el-button>
            </el-input>
          </el-form-item>
          <el-form-item label="给药途径ID">
            <el-input v-model="addRuleData.routeName" size="medium">
              <el-button slot="append" @click="showRoute(1)">选择</el-button>
            </el-input>
          </el-form-item>
          <el-form-item label="给药类型">
            <el-select v-model="addRuleData.routeType" size="medium" placeholder="请选择">
              <el-option
                v-for="item in RouteOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="给药描述">
            <el-input v-model="addRuleData.routeDesc" size="medium"></el-input>
          </el-form-item>
          <el-form-item label="警示级别">
            <el-select v-model="addRuleData.slCode" size="medium" placeholder="请选择">
              <el-option
                v-for="item in SlOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="警示信息">
            <el-input v-model="addRuleData.warning" size="medium"></el-input>
          </el-form-item>
          <el-form-item label="内容">
            <el-input
              type="textarea"
              :autosize="{ minRows: 5, maxRows:5}"
              v-model="addRuleData.content"
              size="medium"
            ></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="addRule()">新 增</el-button>
        <el-button @click="dialogVisible = false">取 消</el-button>
      </span>
    </el-dialog>

    <!-- 选择给药途径ID -->
    <el-dialog
      title="选择给药途径"
      :visible.sync="RouteVisible"
      class="editDialog"
      width="30%"
      :before-close="handleClose"
    >
      <div style="width:100%;height:527px">
        <div class="addInput">
          <el-input v-model="routeData.srm" size="small" placeholder="请输入内容"></el-input>
          <el-button style="margin-right:8px" type="primary" size="small" @click="SearchRoute()">搜索</el-button>
        </div>
        <el-table
          :data="routeData.tableData"
          stripe
          border
          height="400"
          style="width: 100%;font-size: 10px"
          :header-cell-style="{'text-align':'center'}"
          :row-style="{height:'40px'}"
          :cell-style="{'text-align':'center',padding:'0px'}"
          @row-click="handleRow1"
          @selection-change="handleSelectionChange1"
        >
          <el-table-column label width="35">
            <template slot-scope="scope">
              <el-radio
                :label="scope.row"
                v-model="routeData.radioId"
                @change.native="handleSelectionChange1(scope.row)"
              >&nbsp;</el-radio>
            </template>
          </el-table-column>

          <el-table-column prop="routeId" width="150" label="给药途径编码"></el-table-column>
          <el-table-column prop="routeName" label="给药途径名称"></el-table-column>
        </el-table>
        <!-- <el-pagination background layout="prev, pager, next" :total="1000"></el-pagination> -->
        <div class="dialogBlock">
          <el-pagination
            @size-change="handleSizeChange1"
            @current-change="handleCurrentChange1"
            current-page.sync="1"
            :page-size="100"
            layout="total, prev, pager, next"
            :total="routeData.total"
          ></el-pagination>
        </div>
        <span slot="footer" class="dialog-footer">
          <div class="SortFoot">
            <el-button
              style="margin-right:8px"
              type="primary"
              size="small"
              @click="SelectRoute()"
            >确定</el-button>
            <el-button style="margin-right:8px" @click="RouteVisible = false" size="small">取消</el-button>
          </div>
        </span>
      </div>
    </el-dialog>
    <!-- 选择疾病ID -->
    <el-dialog
      title="选择疾病"
      :visible.sync="DiseaseVisible"
      class="editDialog"
      width="30%"
      :before-close="handleClose"
    >
      <div style="width:100%;height:527px">
        <div class="addInput">
          <el-input v-model="DiseaseData.srm" size="small" placeholder="请输入内容"></el-input>
          <el-button
            style="margin-right:8px"
            type="primary"
            size="small"
            @click="SearchDisease()"
          >搜索</el-button>
        </div>
        <el-table
          :data="DiseaseData.tableData"
          stripe
          border
          height="400"
          style="width: 100%;font-size: 10px"
          :header-cell-style="{'text-align':'center'}"
          :row-style="{height:'40px'}"
          :cell-style="{'text-align':'center',padding:'0px'}"
          @row-click="handleRow"
          @selection-change="handleSelectionChange"
        >
          <el-table-column label width="35">
            <template slot-scope="scope">
              <el-radio
                :label="scope.row"
                v-model="DiseaseData.radioId"
                @change.native="handleSelectionChange(scope.row)"
              >&nbsp;</el-radio>
            </template>
          </el-table-column>

          <el-table-column prop="zddm" width="150" label="诊断代码"></el-table-column>
          <el-table-column prop="zdmc" label="诊断名称"></el-table-column>
        </el-table>
        <!-- <el-pagination background layout="prev, pager, next" :total="1000"></el-pagination> -->
        <div class="dialogBlock">
          <el-pagination
            @size-change="handleSizeChange3"
            @current-change="handleCurrentChange3"
            current-page.sync="1"
            :page-size="100"
            layout="total, prev, pager, next"
            :total="DiseaseData.total"
          ></el-pagination>
        </div>
        <span slot="footer" class="dialog-footer">
          <div class="SortFoot">
            <el-button
              style="margin-right:8px"
              type="primary"
              size="small"
              @click="SelectDisease()"
            >确定</el-button>
            <el-button style="margin-right:8px" @click="DiseaseVisible = false" size="small">取消</el-button>
          </div>
        </span>
      </div>
    </el-dialog>
    <!-- 所有规则 -->
    <el-dialog
      title="所有药物禁忌规则"
      :visible.sync="RuleAllVisible"
      class="editDialog"
      width="75%"
      stripe
      :before-close="handleClose"
    >
      <div>
        <el-card style="height:530px">
          <el-table
            :data="RuleAllData.RuleAllTableList"
            :header-cell-style="{'text-align':'center'}"
            :cell-style="{'text-align':'center',padding:'0px'}"
            border
            stripe
            height="450"
            style="width: 100%"
          >
            <el-table-column type="index" label="序号" width="50"></el-table-column>
            <el-table-column label="操作" width="100">
              <template slot-scope="scope">
                <el-button
                  type="text"
                  style="margin-right:12px"
                  @click="showRuleOne(scope.row.id)"
                >查看</el-button>
                <el-button type="text" @click="open(scope.row.id)">删除</el-button>
              </template>
            </el-table-column>

            <el-table-column prop="drugId" label="药物禁忌症ID" width="130"></el-table-column>
            <el-table-column prop="diseaseId" label="疾病id" width="130"></el-table-column>
            <el-table-column prop="routeIds" label="给药途径id" width="130"></el-table-column>
            <el-table-column label="给药类型" width="120">
              <template
                slot-scope="scope"
              >{{(scope.row.routeType==1)?"全身给药":(scope.row.routeType==2)?"局部给药":(scope.row.routeType==3)?"所有方式给药":"系统默认"}}</template>
            </el-table-column>
            <el-table-column prop="routeDesc" label="给药描述" width="100"></el-table-column>
            <el-table-column prop="slCode" label="警示级别" width="100">
              <template slot-scope="scope">
                <!-- 0:拦截，1：禁忌，2：不推荐，3：轻微 -->
                {{(scope.row.slCode==0)?"拦截":(scope.row.slCode==1)?"禁忌":(scope.row.slCode==2)?"不推荐":(scope.row.slCode==3)?"轻微":""}}
              </template>
            </el-table-column>
            <el-table-column prop="warning" label="警示内容" width="150"></el-table-column>
            <el-table-column label="内容">
              <template slot-scope="scope">
                <div v-html="scope.row.content"></div>
              </template>
            </el-table-column>
          </el-table>
          <el-pagination
            @size-change="handleSizeChange2"
            @current-change="handleCurrentChange2"
            :current-page="1"
            :page-sizes="[20, 30, 50]"
            :page-size="100"
            layout="total, sizes, prev, pager, next, jumper"
            :total="RuleAllData.total"
          ></el-pagination>
        </el-card>
      </div>
    </el-dialog>
    <!-- 查看规则 -->
    <el-dialog
      title="药物禁忌规则"
      :visible.sync="showRuleOneVisible"
      width="35%"
      :before-close="handleClose"
    >
      <div class="addRuleAdverse">
        <el-form
          :inline="true"
          :model="showRuleOneData"
          class="demo-form-inline"
          label-width="150px"
        >
          <el-form-item label="疾病ID">
            <el-input v-model="showRuleOneData.diseaseId" size="medium">
              <el-button slot="append" @click="showDisease(2)">选择</el-button>
            </el-input>
          </el-form-item>
          <el-form-item label="给药途径">
            <el-input v-model="showRuleOneData.routeIds" size="medium">
              <el-button slot="append" @click="showRoute(2)">选择</el-button>
            </el-input>
          </el-form-item>
          <el-form-item label="给药类型">
            <el-select v-model="showRuleOneData.routeType" size="medium" placeholder="请选择">
              <el-option
                v-for="item in RouteOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="给药描述">
            <el-input v-model="showRuleOneData.routeDesc" size="medium"></el-input>
          </el-form-item>
          <el-form-item label="警示级别">
            <el-select v-model="showRuleOneData.slCode" size="medium" placeholder="请选择">
              <el-option
                v-for="item in SlOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="警示信息">
            <el-input v-model="showRuleOneData.warning" size="medium"></el-input>
          </el-form-item>
          <el-form-item label="内容">
            <el-input
              type="textarea"
              v-model="showRuleOneData.content"
              :autosize="{ minRows: 5, maxRows: 5}"
              size="medium"
            ></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="updateRuleOne()">更 新</el-button>
        <el-button @click="showRuleOneVisible = false">取 消</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import {
  //   getRuleListContr,
  //   addRuleInfoContr,
  //   showRuleAllContr,
  //   showRuleOneContr,
  //   updateRuleOneContr,
  //   deleteRuleContr
  getRuleListContr,
  addRuleInfoContr,
  showRuleAllContr,
  showRuleOneContr,
  updateRuleOneContr,
  deleteRuleContr,
  showRuleDiseaseAge,
  getRoute,
} from "@/api/rad";
export default {
  data() {
    return {
      multipleSelection: {},
      queryInfo: {
        srm: "",
        page: 1,
        pageSize: 20,
      },
      total: 0,
      tableData: [],
      SlOptions: [
        {
          value: 0,
          label: "拦截",
        },
        {
          value: 1,
          label: "禁忌",
        },
        {
          value: 2,
          label: "不推荐",
        },
        {
          value: 3,
          label: "轻微",
        },
      ],
      // 0无肝损害1肝功能不全2轻度肝损害3中度肝损害4重度肝损害
      HepOptions: [
        {
          value: 0,
          label: "无肝损害",
        },
        {
          value: 1,
          label: "肝功能不全",
        },
        {
          value: 2,
          label: "轻度肝损害",
        },
        {
          value: 3,
          label: "中度肝损害",
        },
        {
          value: 4,
          label: "重度肝损害",
        },
      ],
      RouteOptions: [
        {
          value: 1,
          label: "全身给药",
        },
        {
          value: 2,
          label: "局部给药",
        },
        {
          value: 3,
          label: "所有方式给药",
        },
      ],
      CalOptions: [
        {
          value: 1,
          label: "常规",
        },
        {
          value: 2,
          label: "体重",
        },
        {
          value: 3,
          label: "体表",
        },
      ],
      LowUnitOptions: [
        {
          value: "周",
          label: "周",
        },
        {
          value: "月",
          label: "月",
        },
        {
          value: "年",
          label: "年",
        },
      ],
      LowOptions: [
        {
          value: 0,
          label: "等于",
        },
        {
          value: 1,
          label: "不等于",
        },
      ],
      dialogVisible: false,
      RouteVisible: false,
      routeData: {
        srm: "",
        page: 1,
        pageSize: 20,
        load: 0,
        total: 0,
        tableData: [],
        radioId: [],
      },
      addRuleData: {
        drugCode: "",
        // drugId:"",
        diseaseId: "",
        diseaseName: "",
        routeIds: "",
        routeName: "",
        routeType: "",
        routeDesc: "",
        slCode: "",
        warning: "",
        content: "",
      },
      RuleAllVisible: false,
      RuleAllData: {
        drugCode: "",
        // geriatricDrugId: "",
        // routeDrugId: "",
        hepdosageId: "",
        page: 1,
        pageSize: 20,
        total: 0,
        RuleAllTableList: [],
      },
      showRuleOneVisible: false,
      showRuleOneData: {
        id: "",
        drugId: "",
        diseaseId: "",
        routeIds: "",
        routeType: "",
        routeDesc: "",
        slCode: "",
        warning: "",
        content: "",
      },
      DiseaseVisible: false,
      DiseaseData: {
        srm: "",
        page: 1,
        pageSize: 20,
        load: 0,
        total: 0,
        tableData: [],
        radioId: [],
      },
    };
  },
  created: function () {
    this.getRuleListContr();
  },
  methods: {
    handleClose(done) {
      done();
    },
    handleSizeChange(newSize) {
      this.queryInfo.pageSize = newSize;
      //console.log(this.queryInfo);
      this.getRuleListContr();
    },

    handleCurrentChange(newPage) {
      this.queryInfo.page = newPage;
      //console.log(this.queryInfo);
      this.getRuleListContr();
    },
    handleSizeChange1(newSize) {
      this.routeData.pageSize = newSize;

      this.getRouteJson();
    },
    handleCurrentChange1(newPage) {
      this.routeData.page = newPage;
      this.getRouteJson();
    },
    handleSizeChange2(newSize) {
      this.RuleAllData.pageSize = newSize;
      this.showRuleAllContr();
    },
    handleCurrentChange2(newPage) {
      this.RuleAllData.page = newPage;
      this.showRuleAllContr();
    },
    handleSizeChange3(newSize) {
      this.RuleAllData.pageSize = newSize;
      this.getDiseaseJson();
    },
    handleCurrentChange3(newPage) {
      this.RuleAllData.page = newPage;
      this.getDiseaseJson();
    },
    async getRuleListContr() {
      let res = await this.$rad.getRuleListContr({
        srm: this.queryInfo.srm,
        page: this.queryInfo.page,
        pageSize: this.queryInfo.pageSize,
      });
      (this.tableData = res.rows), (this.total = res.total);
      //console.log(res.rows);
    },
    getSearchList() {
      this.getRuleListContr();
    },
    clearEvent() {},
    showAddRule(drugCode) {
      this.addRuleData.drugCode = drugCode;
      this.dialogVisible = true;
    },
    showRoute(load) {
      this.RouteVisible = true;
      this.routeData.load = load;
      this.getRouteJson();
    },
    SearchRoute() {
      this.routeData.page = 1;
      this.getRouteJson();
    },
    async getRouteJson() {
      let res = await this.$rad.getRouteJson({
        srm: this.routeData.srm,
        page: this.routeData.page,
        pageSize: this.routeData.pageSize,
      });
      // console.log(res);
      this.routeData.tableData = res.rows;
      this.routeData.total = res.total;
    },
    showDisease(load) {
      this.DiseaseVisible = true;
      this.DiseaseData.load = load;
      this.getDiseaseJson();
    },
    SearchDisease() {
      this.DiseaseData.page = 1;
      this.getDiseaseJson();
    },
    async getDiseaseJson() {
      let res = await this.$rad.showRuleDiseaseAge({
        srm: this.DiseaseData.srm,
        page: this.DiseaseData.page,
        pageSize: this.DiseaseData.pageSize,
      });
      //console.log(res);
      this.DiseaseData.tableData = res.rows;
      this.DiseaseData.total = res.total;
    },
    SelectRoute() {
      if (this.routeData.radioId.length == 0) {
        this.$message({
          type: "warning",
          message: "请选择给药途径",
        });
      } else {
        if (this.routeData.load == 1) {
          // console.log(this.routeData.radioId);
          console.log(1);
          this.addRuleData.routeName = this.routeData.radioId.routeName;
          this.addRuleData.routeIds = this.routeData.radioId.routeId;
          //console.log(this.addRuleData.routeName);
          //console.log(this.addRuleData.routeIds);
        } else if (this.routeData.load == 2) {
          console.log(2);
          this.showRuleOneData.routeName = this.routeData.radioId.routeName;
          this.showRuleOneData.routeIds = this.routeData.radioId.routeId;
        }
        this.RouteVisible = false;
      }
    },
    SelectDisease() {
      if (this.DiseaseData.radioId.length == 0) {
        this.$message({
          type: "warning",
          message: "请选择疾病ID",
        });
      } else {
        if (this.DiseaseData.load == 1) {
          this.addRuleData.diseaseId = this.DiseaseData.radioId.zddm;
          this.addRuleData.diseaseName = this.DiseaseData.radioId.zdmc;
          console.log(1);
          //console.log(this.addRuleData.diseaseId);
        } else if (this.DiseaseData.load == 2) {
          console.log(2);
          this.showRuleOneData.diseaseId = this.DiseaseData.radioId.zddm;
          this.showRuleOneData.diseaseName = this.DiseaseData.radioId.zdmc;
        }
        this.DiseaseVisible = false;
      }
    },
    async addRule() {
      console.log(this.addRuleData);
      let res = await this.$rad.addRuleInfoContr({
        drugCode: this.addRuleData.drugCode,
        icdCode: this.addRuleData.diseaseId,
        routeIds: this.addRuleData.routeIds,
        routeType: this.addRuleData.routeType,
        routeDesc: this.addRuleData.routeDesc,
        slCode: this.addRuleData.slCode,
        warning: this.addRuleData.warning,
        content: this.addRuleData.content,
      });
      console.log(this.addRuleData);
      if (res.code == 1) {
        this.dialogVisible = false;
        this.getRuleListContr();
        this.clearAddRuleData();
        return this.$message({
          type: "success",
          message: res.msg,
        });
      } else {
        return this.$message({
          type: "error",
          message: res.msg,
        });
      }
    },
    showRuleAll(drugCode, hepdosageId) {
      this.RuleAllData.drugCode = drugCode;
      this.RuleAllData.hepdosageId = hepdosageId;
      this.RuleAllVisible = true;
      this.showRuleAllContr();
    },
    async showRuleAllContr() {
      let res = await this.$rad.showRuleAllContr({
        drugId: this.RuleAllData.hepdosageId,
        page: this.RuleAllData.page,
        pageSize: this.RuleAllData.pageSize,
      });
      this.RuleAllData.RuleAllTableList = res.rows;
      this.RuleAllData.total = res.total;
      console.log(res);
    },
    showRuleOne(id) {
      this.showRuleOneData.id = id;
      // //console.log(id);
      this.showRuleOneVisible = true;
      this.showRuleOneContr();
    },
    async showRuleOneContr() {
      let res = await this.$rad.showRuleOneContr({
        id: this.showRuleOneData.id,
      });
      console.log(res);
      (this.showRuleOneData.drugId = res.data.drugId),
        (this.showRuleOneData.diseaseId = res.data.diseaseId),
        (this.showRuleOneData.routeIds = res.data.routeIds),
        (this.showRuleOneData.routeType = res.data.routeType),
        (this.showRuleOneData.routeDesc = res.data.routeDesc),
        (this.showRuleOneData.slCode = res.data.slCode),
        (this.showRuleOneData.warning = res.data.warning);
      this.showRuleOneData.content = res.data.content;
      console.log(this.showRuleOneData);
    },
    async updateRuleOne() {
      // //console.log(this.showRuleOneData);
      let res = await this.$rad.updateRuleOneContr({
        id: this.showRuleOneData.id,
        drugId: this.showRuleOneData.drugId,
        diseaseId: this.showRuleOneData.diseaseId,
        routeIds: this.showRuleOneData.routeIds,
        routeType: this.showRuleOneData.routeType,
        routeDesc: this.showRuleOneData.routeDesc,
        slCode: this.showRuleOneData.slCode,
        warning: this.showRuleOneData.warning,
        content: this.showRuleOneData.content,
      });
      if (res.code == 1) {
        this.showRuleOneVisible = false;
        this.showRuleAllContr();
        return this.$message({
          type: "success",
          message: res.msg,
        });
      } else {
        return this.$message({
          type: "success",
          $message: res.msg,
        });
      }
    },
    open(id) {
      this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.deleteRuleContr(id);
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    async deleteRuleContr(id) {
      let res = await this.$rad.deleteRuleContr({
        id: id,
        drugId: this.RuleAllData.hepdosageId,
      });
      //console.log(res);
      if (res.code == 1) {
        this.showRuleAllContr();
        this.getRuleListContr();
        return this.$message({
          type: "success",
          message: res.msg,
        });
      } else {
        return this.$message({
          type: "success",
          $message: res.msg,
        });
      }
    },
    clearAddRuleData() {
      // (this.addRuleData.drugCode = ""),
      //   (this.addRuleData.routeId = ""),
      //   (this.addRuleData.routeName = ""),
      //   (this.addRuleData.slCode = ""),
      //   (this.addRuleData.warning = ""),
      //   (this.addRuleData.abstractDesc = "");
    },
    handleRow(row) {
      console.log(row);
      this.DiseaseData.radioId = row;
      this.multipleSelection = row;
    },
    handleSelectionChange(val) {
      console.log(res);
      this.multipleSelection = val;
    },
    handleRow1(row) {
      console.log(row);
      this.routeData.radioId = row;
      this.multipleSelection = row;
    },
    handleSelectionChange1(val) {
      console.log(res);
      this.multipleSelection = val;
    },
  },
};
</script>
<style scoped>
.SearchCard {
  height: 50px;
  font-size: 12px;
}
.SearchTitle {
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-right: 1px solid #c2c2c2;
}
.SearchLable {
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.TableCard {
  margin-left: 3px;
  margin-top: 2px;
}
.block {
  text-align: center;
  margin-top: 12px;
  margin-bottom: 12px;
}
.editDialog >>> .el-dialog__header {
  margin-bottom: 0px;
}
.editDialog >>> .el-dialog__body {
  padding-left: 0px;
  padding-right: 0px;
}
.addInput {
  height: 45px;
  display: flex;
  align-items: center;
}
.SortFoot {
  height: 50px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.addInput >>> .el-input {
  width: 40%;
  margin-left: 8px;
}
.addInput >>> .el-button {
  margin-left: 8px;
}
.dialogBlock {
  margin-top: 0px;
  margin-bottom: 0px;
}
.addForm >>> .el-form-item__content {
  width: 200px;
}
</style>
